﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateIntercourseInfo.aspx.cs" Inherits="admin_UpdateIntercourseInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>

    <link rel="Stylesheet" type="text/css" href="../Styles/right_style.css" />
    <script type="text/javascript" src="../Scripts/jquery.ui/js/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/My97DatePicker/WdatePicker.js"></script>

    <style type="text/css">
        <!--
        html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
        scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
        -->
        </style>

</head>
<body>
    <form id="form1" runat="server">
            <div class="sub_right_top">
  <div class="hdm_header" >
    <div class="tb1_on"><h2 class="h2_icon">交往信息管理</h2></div>

    <div class="clear"></div>
  </div>
  <div class="hdm_footer">
    <div style="height:13px; overflow:hidden;"></div>            
    <table width="97%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#77acd0" style="border-collapse:collapse; ">
      <tr bgcolor="#b1d5ef">
        <td colspan="2">交往记录信息编辑</td>
        </tr>

      <tr>
        <td width="120">客户名称：</td>
        <td>
          <div class="disk_liulan_one">
            <asp:TextBox ID="txtClient" runat="server" ReadOnly="True" Width="326px" 
                  Height="16px"></asp:TextBox>
          </div>
          <div class="disk_liulan_tow">
            <asp:Button ID="Button1" runat="server" Text="" CssClass="contact_xuanze" OnClientClick="val = window.showModalDialog ('SelectClient.aspx', '','status:no;center:yes;scroll:yes;resizable:no;help:no;dialogWidth:300px;dialogHeight:300px');document.getElementById('txtClient').value = val[1];document.getElementById('hidClientId').value = val[0];return false;" />
                  </div>          </td>
      </tr>
      <tr>

        <td width="120">交往日期：</td>
        <td>
                <asp:TextBox ID="txtIntercourseInfoDate" runat="server" CssClass="Wdate" onClick="WdatePicker()" Width="80%"></asp:TextBox>    
             </td>
      </tr>
      <tr>
        <td width="120">交往内容：</td>
        <td>
        <asp:TextBox ID="txtIntercourseInfoContent" runat="server" Height="50px" Width="80%"></asp:TextBox>  
              </td>
      </tr>
      <tr>
        <td width="120">联系人：</td>
        <td>
          <asp:TextBox ID="txtLinkman" runat="server" Width="80%"></asp:TextBox>
                </td>
      </tr>

      <tr>
        <td width="120">备注：</td>
        <td>
                <asp:TextBox ID="txtRemark" runat="server" Height="50px" Width="80%"></asp:TextBox>
               </td>
      </tr>      
      <tr bgcolor="#b1d5ef">
        <td colspan="2" align="center"><div class="disk_queding_top">
                <asp:Button ID="Button3" runat="server" Text="" CssClass="queding_anniu" OnClick="Button2_Click" OnClientClick="return checkfrm()" />
        </div>
          <div class="disk_back_top">
                <asp:Button ID="btnBack" runat="server"
                                    Text=""  CssClass="fanhui_anniu" CausesValidation="False" OnClick="btnBack_Click" />
          </div></td>
        </tr>
    </table>
    <div style="height:15px; overflow:hidden;"></div>
  </div>
</div>
        <asp:HiddenField ID="hidClientId" runat="server" />
    </form>
</body>
</html>
<script type="text/javascript">
var strTime;
var reVal;
function GetDate (nText)
{
    reVal = window.showModalDialog ("../inc/date.htm", '',
        "status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:255px;dialogHeight:260px");
    if (reVal != null)
    {
        nText.value = reVal;
    }
}
function checkfrm()
{
    if(document.getElementById('txtClient').value=='')
    {
        alert('客户名称不能为空！');
        return false;
    }
    if(!CheckDate(document.getElementById('txtIntercourseInfoDate').value))
    {
        alert('请输入格式正确的日期\n\r日期格式：yyyy-mm-dd\n\r例    如：2008-08-08\n\r');
        return false;
    }
    return true;
}
function CheckDate (strDate)
{
    var nStart;
    var nEnd;
    var nYear;
    var nMonth;
    var nDay;
    var nFact;
    var arrDay = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    strDate = (TrimString (strDate));
    if (strDate.length == 0)
        return (false);
    reVal = /^([1-2]\d{3})[\/|\-](0?[1-9]|10|11|12)[\/|\-]([1-2]?[0-9]|0[1-9]|30|31)$/;
    if (!reVal.test (strDate))
        return (false);
    nStart = strDate.indexOf ("/", 0);
    nEnd = strDate.indexOf ("/", nStart + 1);
    nYear = eval (strDate.substring (0, nStart));
    nMonth = eval (strDate.substring (nStart + 1, nEnd));
    nDay = eval (strDate.substring (nEnd + 1, strDate.length));
    nFact = arrDay[nMonth - 1];
    if (nMonth == 2)
    {
        if ((nYear % 4 == 0 && nYear %100 != 0) || (nYear % 400 == 0))
            nFact ++;
    };
    if (nDay > nFact)
        return (false);
    return (true);
}
function TrimString (strVal)
{
    strTmp = strVal + "";
    if (strTmp.length == 0)
        return (strTmp);
    reVal = /^(\s|　)*/;
    strTmp = strTmp.replace (reVal, '');
    reVal = /(\s|　)*$/;
    return (strTmp.replace (reVal, ''));
}
</script>
